cmake_minimum_required(VERSION 3.5)
project(swarm_plan)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++14)
add_definitions(-std=c++14)

# # 指定库路径
# file(GLOB_RECURSE PYTHON2.7_LIB "/usr/lib/python2.7/config-x86_64-linux-gnu/*.so")
# # 指定头文件路径
# set(PYTHON2.7_INLCUDE_DIRS "/usr/include/python2.7")
# include_directories(include ${PYTHON2.7_INLCUDE_DIRS})

include_directories("/usr/include/eigen3")

# include_directories("/usr/include/glog")
# include_directories("/usr/local/lib/cmake/Ceres/")
find_package(PythonLibs 2.7)

# find_package(Ceres REQUIRED)
find_package(Eigen3 3.3 REQUIRED)
# find_package(gflags 2.2.0)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
    roscpp
    rospy
    std_msgs
    geometry_msgs
    message_generation
    roslib
    )

## Generate messages in the 'msg' folder
add_message_files(
    FILES
    UavsInfoStamped.msg
    FormationInfo.msg
    )


## Generate added messages and services with any dependencies listed here
generate_messages(
    DEPENDENCIES
    std_msgs
    geometry_msgs
    )

catkin_package(
    #  INCLUDE_DIRS include
    #  LIBRARIES nlink
    CATKIN_DEPENDS message_runtime
    #  DEPENDS system_lib
    )

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
    include
    ${catkin_INCLUDE_DIRS}
    )

add_library(optitopolib src/optitopo/optitopo.cpp include/optitopo.h)

# add_executable(testplot src/optitopo/testplot.cpp include/matplotlibcpp.h)
# target_include_directories(testplot PRIVATE ${PYTHON_INCLUDE_DIRS})
# target_link_libraries(testplot ${PYTHON_LIBRARIES})

add_executable(swarm_info_recv src/control/swarm_info_recv.cpp)
add_dependencies(swarm_info_recv   ${PROJECT_NAME}_generate_messages_cpp)
target_link_libraries(swarm_info_recv  ${catkin_LIBRARIES}  )

add_executable(swarm_plan src/control/plan_centralized.cpp)
add_dependencies(swarm_plan   ${PROJECT_NAME}_generate_messages_cpp)
target_link_libraries(swarm_plan  ${catkin_LIBRARIES}  optitopolib)

add_executable(gimbal_yaw_control src/control/gimbal_yaw_control.cpp)
target_link_libraries(gimbal_yaw_control  ${catkin_LIBRARIES})

add_executable(swarm_control src/control/swarm_control.cpp)
target_link_libraries(swarm_control  ${catkin_LIBRARIES})


# add_executable(testopt src/optitopo/testopt.cpp include/matplotlibcpp.h)
# target_link_libraries(testopt ${catkin_LIBRARIES} PIDlib optitopolib  ${PYTHON_LIBRARIES})
# target_include_directories(testopt PRIVATE ${PYTHON_INCLUDE_DIRS})



